from common.unit import AndroidUI


#回收界面,科室装箱
class RecoverBoxObject:

    def __init__(self):
        self.driver = AndroidUI.get_webdriver()

    # 登录信息
    def login_name(self):
        element = self.driver.find_element_by_id("com.bluephone:id/login_name_text")
        return element

    # 重启蓝牙
    def restart_bluetooth_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/restart_bluetooth")
        return element

    # 置零
    def clear_zero_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/clear_zero")
        return element

    # 科室认证按钮
    def department_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/depart_name")
        # com.bluephone: id / depart_name
        return element

    # 护士认证按钮
    def nurse_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/doctors_name")
        return element

    # 感染性
    def infectious_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/bag_type_1")
        return element

    # 损伤性
    def injure_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/bag_type_2")
        return element

    # 化学性
    def chemistry_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/bag_type_3")
        return element

    # 药物性
    def drug_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/bag_type_4")
        return element

    # 病理性
    def ill_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/bag_type_5")
        return element

    # 其他
    def other_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/bag_type_6")
        return element

    # 点击其他，弹窗中的输入框
    def type_input(self):
        element = self.driver.find_element_by_id("com.bluephone:id/other_et")
        return element

    # 点击其他，弹窗中的确定按钮
    def other_ok_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/other_ok")
        return element

    # 新冠
    def xinguan_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/bag_type_7")
        return element

    # 实时重量
    def weight_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/date_text")
        return element

    # 输入重量
    def weight_input(self):
        element = self.driver.find_element_by_id("android:id/input")
        return element

    # 重量那边的确定按钮
    def ok_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/md_buttonDefaultPositive")
        return element

    '''

    在科室装箱模式中，选择了一种类型后，可以通过selected属性判断是选择
    在科室装箱模式中，选择了一种类型并且点击打印后，其他类型按钮都会置灰，不能点击通过  is_enabled
    点击打印后“封箱”按钮从灰色不可点击变为可点击，enabled判断
    '''


    # 打印按钮
    def print_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/out_code")
        return element

    #封箱按钮
    def seal_box_button(self):
        element=self.driver.find_element_by_id('com.bluephone:id/inbox')
        return element

    #箱列表按钮
    def box_list_button(self):
        element=self.driver.find_element_by_id('com.bluephone:id/listbox')
        return element

    # 返回按钮
    def back_button(self):
        element = self.driver.find_element_by_id("com.bluephone:id/iv_back")
        return element


if __name__ == '__main__':
    pass
